//检测文件更新
import { autoRefresh } from './auto-update'
const location = XEUtils.parseUrl(window.location.href)
window.corpId = location.searchQuery.corpId || (location.host.indexOf('daohe-pre.dingapps.cn') > -1 && 'dingf8f045562df6ae35a39a90f97fcb1e09') || 'dinga54347b089e75e4f35c2f4657eb6378f'
window.isDev = process.env.NODE_ENV === 'development' ? true : false //开发环境
//客户端环境判断
if (window && window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('DingTalk') >= 0) {
    window.appType = '1钉钉'
} else {
    window.appType = '浏览器'
}
//终端类型
let userAgent = navigator.userAgent,
    Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod', 'Mobile']
window.isMob = Agents.some(i => {
    return userAgent.includes(i)
})
//手机端增加调试环境
const isIPAndPort = /^[0-9.:]+$/.test(window.location.host)
// if (window.isMob && !isIPAndPort) eruda.init()
//测试环境自动监测静态资源更新
if (window.location.href.indexOf('dingapps.cn') > -1) autoRefresh()
